#include"RBTree.hpp"
#include"AVLTree.hpp"
#include<vector>
#include<time.h>
void test()
{
    srand(time(0));
    const int n = 100000;
    vector<int> v;
    v.reserve(n);
    for(size_t i = 0;i<n;i++)
    {
        v.push_back(rand());
    }
    xzq1::RBTree<int,int> rbtree;
    xzq::AVLtree<int,int> avltree;
    size_t begin1 = clock();
    for(auto e : v)
    {
        rbtree.Insert(make_pair(e,e));
    }
    size_t end1 = clock();
    size_t begin2 = clock();
    for(auto e : v)
    {
        avltree.Insert(make_pair(e,e));
    }
    size_t end2 = clock();
    cout<<"rbtree : "<<end1 - begin1<<endl;
    cout<<"avltree : "<<end2 - begin2<<endl;
}
int main()
{
    //xzq1::test();
    test();
    return 0;
}